package ch.ethz.fcl.metrobuzz.controller.gui.twl.treetable;

import de.matthiasmann.twl.model.AbstractTreeTableNode;
import de.matthiasmann.twl.model.TreeTableNode;

public class MBTreeTableNode extends AbstractTreeTableNode{
	private Object obj0;
	private Object obj1;

	public MBTreeTableNode(TreeTableNode parent, Object obj0, Object obj1) {
		super(parent);
		this.obj0 = obj0;
		this.obj1 = obj1;
		setLeaf(true);
	}

	public Object getData(int column) {
		return (column == 0) ? obj0 : obj1;
	}

	public MBTreeTableNode insert(Object obj0, Object obj1) {
		MBTreeTableNode n = new MBTreeTableNode(this, obj0, obj1);
		insertChild(n, getNumChildren());
		setLeaf(false);
		return n;
	}

	public void remove(int idx) {
		removeChild(idx);
	}

	public void removeAll() {
		removeAllChildren();
	}
}
